package com.ruoyi.project.upload.domain;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.converters.bigdecimal.BigDecimalStringConverter;
import com.alibaba.excel.converters.date.DateDateConverter;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;
import com.ruoyi.project.upload.converter.StringImageConverter;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 上传图片信息对象 upload_images
 *
 * @author fanzhihao
 * @date 2023-03-23
 */
@ExcelIgnoreUnannotated
@Data
public class UploadImages extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     *
     */
    private Long id;

    /**
     * 提交人
     */
    private Long userId;

    /**
     * 图片地址
     */
    //@Excel(name = "图片地址")
    @ExcelProperty(converter = StringImageConverter.class)
    @Excel(name = "图片", cellType = Excel.ColumnType.IMAGE, height = 409, width = 31)
    private String url;


    /**
     * 图片中提取的金额
     */

    //@Excel(name = "金额",cellType = Excel.ColumnType.NUMERIC,width = 12)
    private BigDecimal money;

    /**
     * 图片中提取的时间
     */
    @ExcelProperty(converter = DateDateConverter.class)
    @DateTimeFormat("yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "时间", width = 14.25, dateFormat = "yyyy-MM-dd")
    private Date time;

    /**
     * 批次
     */
    private String batch;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    //@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdTime;

}
